import request from '@/utils/request'

export function listTree(){
  return request({
    url: '/dv/type/list',
    method: 'get'
  })
}

export function getInfoType(query){
  return request({
    url: '/dv/type/getInfoType',
    method: 'get',
    params: query
  })
}

// 新增设备类型
export function addType(data){
  return request({
    url: '/dv/type/add',
    method: 'post',
    data: data
  })
}

export function updateType(data){
  return request({
    url: '/dv/type/update',
    method: 'post',
    data: data
  })
}

//得到父级的信息
export function getParentInfo(query){
  return request({
    url: '/dv/type/getParentInfo',
    method: 'get',
    params: {
      parentId: query
    }
  })
}

// 删除设备类型
export function deleteType(query){
  return request({
    url: '/dv/type/delete',
    method: 'get',
    params: {
      machineryTypeId: query
    }
  })
}
